//
//  MessShowView.m
//  bus
//
//  Created by zhanshu-叶国帅 on 15/6/8.
//  Copyright (c) 2015年 ygs. All rights reserved.
//

#import "MessShowView.h"
#import "Toast+UIView.h"
@implementation MessShowView

+ (MessShowView *)share{
    static MessShowView *messShowView = nil;
    static dispatch_once_t once;
    dispatch_once(&once, ^{
        messShowView = [[MessShowView alloc] init];
    });
    return messShowView;
}
- (id)init {
    self = [super init];
    if (self) {
        _isShow = YES;
    }
    return self;
}

- (void)showWithMess:(NSString *)mess{
    if (self.isShow) {
        _isShow = NO;
        UIWindow *window = [UIApplication sharedApplication].delegate.window;
//        UIView *aview = [window.subviews lastObject];
//        [[UIApplication sharedApplication].delegate.window addSubview:aview];
        
        [window makeToast:mess duration:1.0 position:@"center"];
        
        [self performSelector:@selector(delayMethod) withObject:nil afterDelay:1.4];
    }
}

- (void)delayMethod {
    _isShow = YES;
}

@end
